From: Bilal Elmoussaoui Date: Tue, 6 Dec 2022 12:38:48 +0000 (+0000) Subject: padOsd: Replace Gtk accelerator API usage with Mutter X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~182 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1da29b04efb1f89834e2bfe581de2f2903c37e89;p=gnome-shell.git padOsd: Replace Gtk accelerator API usage with Mutter In order to drop the direct dependency of GTK from Mutter in a Wayland only build. The consumer and the producer of the events must be Mutter Depends on https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2407 Part-of: --- diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index e1e24f70c..2442e98fc 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -3,7 +3,7 @@ const { Atk, Clutter, GDesktopEnums, Gio, - GLib, GObject, Gtk, Meta, Pango, Rsvg, St, + GLib, GObject, Meta, Pango, Rsvg, St, } = imports.gi; const Signals = imports.misc.signals; @@ -104,10 +104,9 @@ var KeybindingEntry = GObject.registerClass({ if (event.type() != Clutter.EventType.KEY_PRESS) return Clutter.EVENT_PROPAGATE; - let str = Gtk.accelerator_name_with_keycode(null, - event.get_key_symbol(), - event.get_key_code(), - event.get_state()); + const str = Meta.accelerator_name( + event.get_state(), event.get_key_symbol()); + this.set_text(str); this.emit('keybinding-edited', str); return Clutter.EVENT_STOP;